/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "samplingprotocol")
@NamedQueries({
    @NamedQuery(name = "Samplingprotocol.findAll", query = "SELECT s FROM Samplingprotocol s"),
    @NamedQuery(name = "Samplingprotocol.findByIdsamplingprotocol", query = "SELECT s FROM Samplingprotocol s WHERE s.idsamplingprotocol = :idsamplingprotocol"),
    @NamedQuery(name = "Samplingprotocol.findBySamplingprotocol", query = "SELECT s FROM Samplingprotocol s WHERE s.samplingprotocol = :samplingprotocol")})
public class Samplingprotocol implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idsamplingprotocol")
    private Integer idsamplingprotocol;
    @Basic(optional = false)
    @Column(name = "samplingprotocol")
    private String samplingprotocol;
    @OneToMany(mappedBy = "samplingprotocol", fetch = FetchType.LAZY)
    private List<Eventelement> eventelementList;

    public Samplingprotocol() {
    }

    public Samplingprotocol(Integer idsamplingprotocol) {
        this.idsamplingprotocol = idsamplingprotocol;
    }

    public Samplingprotocol(Integer idsamplingprotocol, String samplingprotocol) {
        this.idsamplingprotocol = idsamplingprotocol;
        this.samplingprotocol = samplingprotocol;
    }

    public Integer getIdsamplingprotocol() {
        return idsamplingprotocol;
    }

    public void setIdsamplingprotocol(Integer idsamplingprotocol) {
        this.idsamplingprotocol = idsamplingprotocol;
    }

    public String getSamplingprotocol() {
        return samplingprotocol;
    }

    public void setSamplingprotocol(String samplingprotocol) {
        this.samplingprotocol = samplingprotocol;
    }

    public List<Eventelement> getEventelementList() {
        return eventelementList;
    }

    public void setEventelementList(List<Eventelement> eventelementList) {
        this.eventelementList = eventelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idsamplingprotocol != null ? idsamplingprotocol.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Samplingprotocol)) {
            return false;
        }
        Samplingprotocol other = (Samplingprotocol) object;
        if ((this.idsamplingprotocol == null && other.idsamplingprotocol != null) || (this.idsamplingprotocol != null && !this.idsamplingprotocol.equals(other.idsamplingprotocol))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Samplingprotocol[idsamplingprotocol=" + idsamplingprotocol + "]";
    }

}
